<?php
    session_start();
    
    function desenha_menu(){
       if (isset($_SESSION['username'])){
             echo '<a href="login.php?logout=1">Terminar sessão</a>';
        }else{
            echo '<a id="pglog" href="PaginaLogada.php">Entrar</a>';
        }            
    }
    
?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>index</title>
		<link rel="stylesheet" type="text/css" href="login.css" media="screen"/>
    </head>
    <body>
	<div id="inicio">
        <h1> 2018 FIFA WC RUSSIA </h1>
		<hr>
      
        
        <p id="bemvindo">
            <?php
                if (isset($_SESSION['username'])){
                    echo 'Bem Vindo ';
                }else{
                    echo 'Bem Vindo '. $_SESSION['nome'];
                }            
            ?>
           
        </p>
        <?php 
            desenha_menu();
        ?>
		<br><br>
    </body>
</html>
